import Mock  from 'mockjs';

import { API_MOCK } from '@/config'

Mock.setup({
    timeout: '0-200'
})
console.log(API_MOCK)
const modules: any = API_MOCK ? import.meta.globEager('./modules/*.ts') : []
console.log(modules)
console.log('======')
const mockModules: any[] = []
Object.keys(modules).forEach((key) => {
    mockModules.push(...modules[key].default)
})

mockModules.forEach(({ url, method, t }) => {
    Mock.mock(url, method, t)
})
